<@_placeMetadata path=path><#assign a=object/></@_placeMetadata>
<form method="post" autocomplete="off" action="cmsTemplate/savePlace" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
    <input type="hidden" name="_csrf" value="<@_csrfToken admin=true/>"/>
    <div class="formBar">
        <ul>
        <#if site.useSsi>
            <li><a class="button" href="cmsTemplate/publishPlace?path=${(path?url)!}&_csrf=<@_csrfToken admin=true/>" target="ajaxTodo"><@t.page 'button.publish'/></a></li>
        </#if>
            <li><a class="button" href="cmsTemplate/deletePlace?path=${(path?url)!}&navTabId=placeTemplate/list&_csrf=<@_csrfToken admin=true/>" title="<@t.page 'confirm.delete_file'/>" target="ajaxTodo"><i class="icon-trash icon-large"></i> <@t.page 'button.delete'/></a></li>
        <#if a?has_content&&a.size gt 0>
    <@_sysAuthorized roleIds=admin.roles url='cmsPlace/dataList'>
        <@_sysDeptPage deptId=admin.deptId!'' pages='/include'+path>
            <li><a class="button" href="cmsPlace/dataList.html?path=${(path?url)!}" target="navTab" rel="cmsPlace/dataList" title="<@t.page 'place_data.place'/>:${(a.alias)!}"><@t.page 'place.management'/></a></li>
        </@_sysDeptPage>
    </@_sysAuthorized>
            <#if a.allowContribute>
        <@_sysAuthorized roleIds=admin.roles url='cmsTemplate/content'>
            <li><a class="button"href="placeTemplate/form.html?path=${(path?url)!}" target="dialog" mask="true"><@t.page 'help.contribute_form'/></a></li>
        </@_sysAuthorized>
            </#if>
        </#if>
            <li><a class="button" href="placeTemplate/metadata.html?path=${(path?url)!}" target="ajax" rel="cmsTemplatePlace"><@t.page 'metadata'/></a></li>
            <@_createLock itemType='placeTemplate' itemId=path userId=admin.id>
                <#if object?has_content||!path?has_content>
            <li><button type="submit" class="buttonActive" title="ctrl+s"<#if path?has_content> close-url="common/unlock?itemType=placeTemplate&itemId=${(path?url)!}"</#if>><@t.page 'button.save'/></button></li>
                <#else>
            <li>
                <@_sysLock userId=admin.id itemType='placeTemplate' itemId=path>
                    <@_sysUser id=(object.userId)!''><#assign lockUser=object.nickName/></@_sysUser>
                <button type="button" class="buttonDisabled" title="${object.createDate}"><@t.page 'lock.message' lockUser/></button>
                </@_sysLock>
            </li>
                </#if>
            </@_createLock>
        </ul>
    </div>
    <h2 class="contentTitle">
         <a class="button" href="cmsTemplate/ftlLookup.html" target="dialog" mask="true"><@t.page 'template.fragment'/></a>
         <a class="button" href="placeTemplate/lookup.html" target="dialog" mask="true"><@t.page 'place'/></a>
         <a class="button" href="cmsWebFile/lookup.html" target="dialog" mask="true"><@t.page 'webfile'/></a>
        <a class="button" href="cmsTemplate/help.html?type=place" target="dialog" mask="true"><@t.page 'template.help'/></a>
    </h2>
    <div class="pageFormContent" layoutH>
           <div>
            <input name="path" type="hidden" value="${path}"/>
            <textarea name="content" class="code" escape="true" mode="freemarkermixed"><@_templateContent path='/include'+path>${(object)!}</@_templateContent></textarea>
        </div>
    </div>
</form>